<?php ob_start(); ?>
<?php
include("config.php");
session_start();
$login = $_POST['txtuname'];
$password = $_POST['txtpassword'];
$query="select * from login_users where username='$login' and password='$password'";
$result=mysql_query($query);
if($result) 
{
if(mysql_num_rows($result) == 1) {
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $login;
$_SESSION['SESS_ROLE']=$member['role'];
//echo "<script>alert('$login');<//script>";
session_write_close();
header("location:displaycomputers.php");
}
else
{
header("location: index.php?error=1");
exit();
}
}
?>
<?php ob_flush(); ?>